package com.zdsoft.crm.quartz;

import javax.mail.MessagingException;
import javax.mail.internet.MimeMessage;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.mail.javamail.MimeMessageHelper;


public class SpringEmailTest {

	@Autowired
	JavaMailSender mailSender;

	
	public void testSmtpSimple() throws MessagingException {
		// 建立邮件消息
		//MimeMessage mimeMessage = mailSender.createMimeMessage();
		//MimeMessageHelper messageHelper = new MimeMessageHelper(mimeMessage);
		// 设置信息
		//messageHelper.setTo("1564523999@qq.com");// 接受email
		//messageHelper.setFrom("787683743@qq.com");// 发送email
		//messageHelper.setSubject("我是标题"); // 标题
		//messageHelper.setText("<html>123</html>", true);
		//mailSender.send(mimeMessage);
		//System.out.println("发送成功");
	}

}
